import request from '@/config/axios'

export interface AddressVO {
  id: number
  gdListId: number
  gdUserId: number
  name: string
  phone: string
  address: string
}

// 查询收获地址分页
export const getAddressPage = async (params) => {
  return await request.get({ url: `/gd/address/page`, params })
}

// 查询收获地址详情
export const getAddress = async (id: number) => {
  return await request.get({ url: `/gd/address/get?id=` + id })
}

// 新增收获地址
export const createAddress = async (data: AddressVO) => {
  return await request.post({ url: `/gd/address/create`, data })
}

// 修改收获地址
export const updateAddress = async (data: AddressVO) => {
  return await request.put({ url: `/gd/address/update`, data })
}

// 删除收获地址
export const deleteAddress = async (id: number) => {
  return await request.delete({ url: `/gd/address/delete?id=` + id })
}

// 导出收获地址 Excel
export const exportAddress = async (params) => {
  return await request.download({ url: `/gd/address/export-excel`, params })
}